<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<form action="car_querys.action" method="post">
	<input type="text" name="data" value=""/>
	<input type="submit" value="提交">
</form>
	<input type="text" class="form-control userId" placeholder="用户ID"
		autofocus name="" value="">
	<input type="password" class="form-control password" placeholder="密码"
		name="" value="">
	<!--  <label class="checkbox">
                   <input type="checkbox" value="remember-me" name=""> 记住我
                   <span class="pull-right"> <a href="#"> 忘记密码?</a></span>
               </label> -->
	<button class="btn btn-lg btn-login btn-block" onclick="o()">登录</button>
	 <script src="js/jquery-1.8.3.min.js"></script>
    <script src="js/json2.js"></script>
    <script type="text/javascript">
        function login() {
           var userId = $('.userId').val(),
               password = $('.password').val();
           var datalist = [{
               username: userId,
               password: password
           }];
           var t=JSON.stringify(datalist);
           $.ajax({
               url: 'user_login.action',
               type: 'POST',
               data: "data="+t,
               dataType:'html'
           })
        }
    </script>
     <script type="text/javascript">
              function o(){
               /*  var carNumber=$('#carNumber').val(),
                    style=$('#style').val(),
                    carOwner=$('#carOwner').val(),
                    seating=$('#seating').val(),
                    color=$('#color').val(); */
                var datalist = {	
                    id: "",
                    car_type: "全部",
                    car_user_id: "",
                    seat_count: "",
                    car_color: "",
                    start:0,
                    count:10
                			
                  };
                //alert(datalist);
                 var dd=JSON.stringify(datalist);
               $.ajax({
                   url: 'car_querys.action',      // 请求的地址
                   type: 'POST',
                   dataType: 'json',
                   data:"data="+dd,
                 success: function(data) {
                	   alert(data["data"][0]["id"]);
                      var t =_.template($("#t1").html());
                      $('#content').html(t({"data":data}));
                      
                   },
                   error: function() {
                      console.log('请求出错');
                   }
               })
              } 
    </script>
</body>
</html>